package com.dragon.www.smarthome.net;

/**
 * WIFI连接工厂
 * Created by Administrator on 2015/8/3 17:11.
 * Email: thinkdata@163.com
 */
public final class WIFIConnectionFactory {

    private static WIFIConnectionFactory connection;

    private WIFIObservable observable;

    private WIFIConnectionFactory() {
        observable = new WIFIObservable();
    }

    /**
     *
     * @return
     */
    public static WIFIConnectionFactory getInstance() {
        if (connection == null) {
            synchronized (WIFIConnectionFactory.class) {
                if (connection == null) {
                    connection = new WIFIConnectionFactory();
                }
            }
        }
        return connection;
    }


    /**
     * 获取监视者
     * @return
     */
    public WIFIObservable getObservable() {
        return this.observable;
    }

    /**
     * WIFI
     */
    public final class WIFIObservable extends AObservable {
        public void handler(Object... args) {
            this.notifyObservers(args);
        }
    }
}
